﻿using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {

            for (int i = 0; i <= 10; i++)
            {
                var b = BitConverter.GetBytes((float)i/10);
                Console.WriteLine(i+" "+GetString(b, 2));
            }
            //Console.WriteLine("Hello World!");
        }
        static string GetString(byte[] b,int toBase)
        {
            string result = "";
            string spanString = "-";
            for (int i = 0; i < b.Length; i++)//逐字节变为2进制字符
            {
                result += Convert.ToString(b[i], toBase) + spanString;
            }
            result = result.Trim(spanString.ToCharArray());
            return result;
        }
    }
}
